package com.bobo.controller;

import com.bobo.base.R;
import com.bobo.pojo.ProdComm;
import com.bobo.service.ProdCommService;
import io.swagger.v3.oas.annotations.Operation;
import io.swagger.v3.oas.annotations.tags.Tag;
import jakarta.annotation.Resource;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

@RestController
@RequestMapping("/prodComm")
@Tag(name = "评论接口")
public class ProdCommController {
    @Resource
    private ProdCommService prodCommService;

    @GetMapping("/prodCommData")
    @Operation(summary = "返回商品评论数据(好评率 好评数量 中评数 差评数)" , description = "根据商品id获取")
    public R<ProdComm> getProdCommData(Long prodId) {
        return R.success(prodCommService.getProdCommDataByProdId(prodId));
    }
}
